﻿using System.Configuration;

namespace SvnDeploy.Service.Cfg
{
    public class BackupSettingsElement : ConfigurationElement
    {
        [ConfigurationProperty("backup")]
        public bool Backup
        {
            get { return (bool)this["backup"]; }
            set { this["backup"] = value; }
        }

        public static BackupSettingsElement Default
        {
            get
            {
                return new BackupSettingsElement
                           {
                               Backup = true,
                               NumberOfBackupsToKeep = 10,
                               Path = @"C:\svndeploy\backup"
                           };
            }
        }

        [ConfigurationProperty("numberOfBackupsToKeep")]
        public int NumberOfBackupsToKeep
        {
            get { return (int)this["numberOfBackupsToKeep"]; }
            set { this["numberOfBackupsToKeep"] = value; }
        }

        [ConfigurationProperty("path")]
        public string Path
        {
            get { return (string)this["path"]; }
            set { this["path"] = value; }
        }
    }
}
